<?php

class RssController extends BaseController {
    var $rss;
    
    public function indexAction($requestData) {		
		$this->getRss();
    }
    
    function addItem($item) {
    	$this->rss .= '
				<item>
					<title>'.
    					$item->name
    				.'</title>
					<link>http://www.peakcamps.com/calendar/'.
    				date('Y', $item->date_start)
    				.'/'. $item->month .'/#'.
    				$item->camp_id
    				.'</link>
					<description>'.
    				sprintf("%s-%s", 
    						date('F j', $item->date_start),
    						date('j', $item->date_end)
    				)
    				."\n"
    				.'Contact: '. htmlentities( strip_tags($item->contact), ENT_QUOTES )
    				.''
    				.'</description>
				</item>';
    }
    
    function getRss() {
    	header('Content-Type: text/xml');
    	/**/
    	echo '<?xml version="1.0"?>
						<rss version="0.91">
							<channel>
								<title>Peak.COM</title>
								<link>http://www.peak.com/</link>
								<description>
									PEAK.COM: Adventure Sports, Endurance Sports, Extreme Sports, Outdoor Sports, People Inspiring People
								</description>
								<language>en-us</language>
					 '
    				. $this->rss
    				. '
    						</channel>
    					</rss>';

    	exit;
    }

}

?>